//引入vue路由
import VueRouter from 'vue-router'
//引入vue
import Vue from 'vue'

//安装VueRouter
Vue.use(VueRouter)

//解决路由报错配置
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

export const router = new VueRouter({
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            name: 'login',
            path: '/login',
            component: () => import('../components/common/login/Login.vue')
        },
        {
            path: '/',
            component: () => import('../components/common/main/Home.vue'),
            children: [
                {
                    name: 'dashboard',
                    path: '/dashboard',
                    meta: { title: '首页' },
                    component: () => import('../components/common/main/Dashboard.vue')
                },
                {
                    name: 'Member',
                    path: '/Member/userList',
                    meta: { title: '医生管理' },
                    component: () => import('../components/ww/Member.vue')
                },
                {
                    name: '挂号费管理',
                    path: '/Registeredfee/Registeredfee_list',
                    meta: { title: '挂号费管理' },
                    component: () => import('../components/mfy/Registeredfee.vue')
                },
                {
                    name: '检查项目费',
                    path: '/Inspectionfee/index',
                    meta: { title: '检查项目费' },
                    component: () => import('../components/hhd/hisinspectionfee.vue')
                },
                {
                    name: '字典表维护',
                    path: '/Dictionary/index',
                    meta: { title: '字典表维护' },
                    component: () => import('../components/hhd/HisdictionaryLists.vue')
                },
                {
                    name:'门诊挂号',
                    path:'/Registration/Registration_add',
                    meta:{title:'门诊挂号'},
                    component:() => import('../components/mfy/HisRegistrationAdd.vue')
                },
                {
                    name:'挂号列表',
                    path:'Registration/Registration_list',
                    meta:{title:'挂号列表'},
                    component:() => import('../components/mfy/HisRegistration.vue')
                },
                {
                    name:'新开就诊',
                    path:'/Doctor/index',
                    meta:{title:'新开就诊'},
                    component:() => import('../components/cyh/SeeDoctor.vue')
                },
                {
                    name:'供应商维护',
                    path:'Supplier/index',
                    meta:{title:'供应商维护'},
                    component:() => import('../components/gs/supplier/hissupplier.vue')
                },
                {
                    name:'采购入库',
                    path:'Inventory/purchase',
                    meta:{title:'采购入库'},
                    component:() => import('../components/gs/purchase/purchase.vue')
                },
                {
                    name:'入库审核',
                    path:'BatchesOfInventory/get_list',
                    meta:{title:'入库审核'},
                    component:() => import('../components/gs/audit/form.vue')
                },
                {
                    name:'库存查询',
                    path:'Inventory/inventory_list',
                    meta:{title:'库存查询'},
                    component:() => import('../components/gs/inventory/inventoryManagement.vue')
                },
                {
                    name:'任务列表',
                    path:'Quartz/quartzList',
                    meta:{title:'任务列表'},
                    component:() => import('../components/gs/quartz/jobDetails.vue')
                },{
                    name:'就诊列表',
                    path:'/Doctor/getVisitList',
                    meta:{title:'就诊列表'},
                    component:() => import('../components/cyh/Prescription.vue')
                },
                {
                    name:'药品管理',
                    path:'Medicines/index',
                    meta:{title:'药品管理'},
                    component:() => import('../components/rzw/Drugs.vue')
                },
                {
                    name:'医生排班',
                    path:'Scheduling/Scheduling_list',
                    meta:{title:'医生排班'},
                    component:() => import('../components/ww/Scheduling.vue')

                },
                {
                    name:'收费发药',
                    path:'Doctor/pkgList',
                    meta:{title:'收费发药'},
                    component:() => import('../components/mfy/HisCarePky.vue')
                },

            ]
        },
        {
            //其他情况错误
            path: '*',
            component: Error
        }
    ]
})
